package com.yzt.minemodule.adapter;

import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.module.LoadMoreModule;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.yzt.zhuju.network.entity.mine.wallet.OrderListBean;
import com.yzt.minemodule.R;
import com.yzt.plugin_imageloader.ImageLoadUtil;

import org.jetbrains.annotations.NotNull;

/**
 * 作者：bobwang
 * 创建时间：2023-11-17 09:56:03
 * 描述：
 */
public class OrderAdapter extends BaseQuickAdapter<OrderListBean, BaseViewHolder> implements LoadMoreModule {

    private  boolean showPay;

    public  void showPay(boolean showpay){
        showPay = showpay;
    }

    public OrderAdapter() {
        super(R.layout.item_order);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder holder, OrderListBean data) {

        // 背景头像
        ImageView cover = holder.getView(R.id.img_cover);
        ImageLoadUtil.loadAvatar(getContext(), data.getCover(), cover, R.mipmap.icon_placeholder_long);

        // 昵称
        holder.setText(R.id.tv_title, data.getSubject());

        holder.setText(R.id.tv_time, data.getInfo());

        holder.setText(R.id.tv_order_time, data.getCreateDate());

        holder.setText(R.id.tv_money, "￥"+data.getAmount());

        holder.setVisible(R.id.img_pay, showPay);
    }
}
